"use strict";
const e = require("../../common/vendor.js"),
  a = require("../../api/request.js");
Math || s();
const s = () => "../Common-components/card-flow.js",
  r = {
    __name: "index",
    setup(s) {
      const r = e.ref([]),
        t = e.ref({
          query: "",
          type: "",
          address: ""
        });
      async function o(e = 1) {
        if ("001" == t.type) {
          const s = await a.requestApi("/clAssifyTravels", {
            keywords: t.query,
            page: e
          });
          console.log(s), r.value = [...r.value, ...s.data]
        } else {
          const s = await a.requestApi("/addressQueryTravels", {
            address: t.address,
            keywords: t.query,
            page: e
          });
          console.log(s), r.value = [...r.value, ...s.data]
        }
      }
      e.onLoad((async a => {
        console.log(a), t.query = a.query, t.type = a.type, t.address = a.address, e.wx$1.setNavigationBarTitle({
          title: a.query
        }), await o()
      }));
      const n = e.ref(1);
      return e.onReachBottom((async () => {
        n.value++, await o(n.value)
      })), (a, s) => ({
        a: e.p({
          userTravels: r.value
        })
      })
    }
  };
wx.createPage(r);